<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title>购买记录</title>
		<link href="../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../css/pullToRefresh.css" />
		<link rel="stylesheet" type="text/css" href="../fonts/iconfont/iconfont.css" />
		<link rel="stylesheet" type="text/css" href="../css/global.css" />
		<style type="text/css">
			.mui-segmented-control.mui-segmented-control-inverted .mui-control-item.mui-active {
				color: #4c968e;
				background: transparent;
				border: none;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar {
				width: 20%;
				background-color: #4c968e;
			}
			
			.mui-slider .mui-segmented-control.mui-segmented-control-inverted~.mui-slider-group .mui-slider-item {
				border: none;
			}
			
			.mui-slider-indicator.mui-segmented-control {
				position: fixed;
				top: 44px;
				z-index: 999;
				padding: 0;
				border-bottom: 1px solid #efefef;
				border-top: 1px solid #efefef;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted .mui-control-item {
				padding: 10px 0;
			}
			
			.mui-segmented-control.mui-segmented-control-inverted~.mui-slider-progress-bar {
				position: fixed;
				top: 84px;
				z-index: 999;
			}
		</style>
	</head>
	<body ng-app="myorders" ng-controller="myorderscontroller">
		<header class="mui-bar mui-bar-nav bg_white">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left colorP"></a>
			<h1 class="mui-title colorP"></h1>
		</header>
		<div class="mui-content">
			<div id="content_box">
				<div class="mui-slider-indicator mui-segmented-control mui-segmented-control-inverted bg_white">
					<a class="mui-control-item mui-active">全部</a>
					<a class="mui-control-item">待付款</a>
					<a class="mui-control-item">待发货</a>
					<a class="mui-control-item">待收货</a>
					<a class="mui-control-item">待评价</a>
				</div>
				<div id="sliderProgressBar" class="mui-slider-progress-bar margin-bottom5px"></div>
				<div class="mui-slider-group" style="padding-top: 44px;">
					<!--全部-->
					<div class="mui-slider-item mui-control-content mui-active" ng-repeat="(index,list) in info">
						<ul class="mui-table-view margin-bottom5px bg_white" ng-repeat="(index,v) in list">
							<li class="paddingl_r_15px_tb11px bg_white border-bottom">
								<div class="user_pic"><img ng-src="{{v.icon}}" /></div> 
								<span class="padding_l line-height30px">{{v.nick}} </span>
							</li>  
							<li class="mui-table-view-cell mui-media" ng-click="openOrderDetail(v.ddid,v.state,v.status)">
								<a href="javascript:;">
									<img class="mui-media-object mui-pull-left goods_pic " ng-src="{{v.image}}">
									<div class="mui-media-body">
										<div class="mui-ellipsis">{{v.trade_name}}</div>
										<div class="mui-clearfix line-height30px"><span class="mui-pull-right colorP font14">工期：<i>{{v.maf_time}}</i>天</span></div>
										<div class="mui-clearfix">
											<span class="mui-pull-left colorRed">￥<i class="goodsPrice">{{v.money}}</i></span>
											<span class="mui-pull-right">x <i class="goodsNum">{{v.num}}</i></span>
										</div>
									</div>
								</a>
							</li>
							<li class="mui-table-view-cell mui-media mui-clearfix">  
								<span class="mui-pull-left">合计：<i class="total_price">{{v.ordermoney}}</i></span> 
								<button ng-click="ordershen(v.id,v.state)" type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14" ng-if="v.state==1 || v.state ==0 && v.status == 1">申请退款</button>
								<button ng-click="evaluate(v.ddid)" type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14" ng-if="v.state==1 && v.status == 1">查看物流</button>
								<button ng-click="ordershen(v.id,v.state)" type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14" ng-if="v.state==1 && v.status == 1">确认收货</button> 
								<button ng-click="pinglun(v.ddid)" type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14" ng-if="v.state==2 && v.status == 1">评价</button>
								<button type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14 have_fishined color999" ng-if="v.state==3">退款中...</button>
								<button type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14 have_fishined color999" ng-if="v.state==4 && v.status == 1">已完成</button> 
								<button ng-click="ordershen(v.id,v.state)" type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14" ng-if="v.state==5">退款失败</button> 
								<button ng-click="ordershen(v.id,v.state)" type="button" class="mui-btn  mui-btn-block width20 padding5px font14 margin-right24 cancel_order_btn" ng-if="v.state==6 && v.status == 0">取消订单</button>  
								<button ng-click="canpay(v.ordermoney,v.ddid,v.trade_name)" type="button" class="mui-btn mui-btn-blue mui-btn-block width20 padding5px font14" ng-if="v.state == 6 || v.status == 0 && v.state == 0">付款</button>
							</li>
						</ul>
					</div>
					<p class="mui-text-center line-height44px" ng-if="not_more==1">没有更多数据了~</p>
					<!--<p class="mui-text-center padding_tb20" ng-if="info == null"><i class="iconfont mui-icon font60">&#xe6e3;</i><br /><br />没有更多内容~</p>-->
				</div>
			</div>
		</div>
	</body>
	<script src="../js/mui.min.js"></script>
	<script src="../js/mui.pullToRefresh.js"></script>
	<script src="../js/mui.pullToRefresh.material.js"></script>
	<script src="../js/open.js"></script>
	<script src="../js/angular.min.js"></script>
	<script src="../js/jquery.min.js"></script>
	<script src="../js/apppublic.js"></script>
	<script src="../js/app/my_orders.js"></script>
	<script type="text/javascript">
		$(function() {
			$('.cancel_order_btn').click(function() {
				$(this).parent().prevAll().remove();
				$(this).parent().remove();
			})
		})
	</script>
	<script type="text/javascript">
		(function($) {
			//阻尼系数
			var deceleration = mui.os.ios ? 0.003 : 0.0009;
			$('.mui-scroll-wrapper').scroll({
				bounce: false,
				indicators: false, //是否显示滚动条
				deceleration: deceleration
			});
			$.ready(function() {
				//循环初始化所有下拉刷新，上拉加载。
				$.each(document.querySelectorAll('.mui-content'), function(index, pullRefreshEl) {
					$(pullRefreshEl).pullToRefresh({
						down: {
							callback: function() {
								var self = this;
								setTimeout(function() {
									loadNews();
									self.endPullDownToRefresh();
								}, 1000);
							}
						},
						up: {
							callback: function() {
								var self = this;
								getValue();
								setTimeout(function() {
									self.endPullUpToRefresh();
								}, 1000);
							}
						}
					});
				});
			});
		})(mui);

		function loadNews() {
			appElement = document.querySelector('[ng-controller=myorderscontroller]');
			$scope = angular.element(appElement).scope();
			res = [];
			cur_page = 1;
			nomore = false;
			$scope.initView();
			$scope.$apply();
		}

		function getValue() {
			appElement = document.querySelector('[ng-controller=myorderscontroller]');
			$scope = angular.element(appElement).scope();
			$scope.initView();
			$scope.$apply();
		}
	</script>

</html>